'use strict';

define(['angular', 'services'], function(angular, services) {

    // 构造控制器模块
    function ControllerModule(name, dependencies) {
        var module = angular.module(name, dependencies);
        module.config(['$controllerProvider', function($controllerProvider) {
            module.register = function(name, constructor) {
                return $controllerProvider.register(name, constructor)
            }
        }]);
        return module;
    }

    return {
        common : new ControllerModule('app.common.controllers', ['app.common.services']),
        home : new ControllerModule('app.home.controllers', ['app.home.services']),
        solr : new ControllerModule('app.solr.controllers', ['app.solr.services']),
        collection : new ControllerModule('app.collection.controllers', ['app.collection.services']),
        client : new ControllerModule('app.client.controllers', ['app.client.services']),
        stat : new ControllerModule('app.stat.controllers', ['app.stat.services']),
        log : new ControllerModule('app.log.controllers', ['app.log.services']),
        system : new ControllerModule('app.system.controllers', ['app.system.services'])
    };
});